#define  _CRT_SECURE_NO_WARNINGS 1

#include "string.h"
#include<string>

class Solution {
public:
    string multiply(string num1, string num2)
    {
        int i = num1.size() - 1;
        int j = num2.size() - 1;
        int addition = 0;
        string s;
        int f1, f2, mul, left;
        while (i >= 0 || j >= 0)
        {
            if (i >= 0)
            {
                f1 = num1[i--] - '0';
            }
            else
            {
                f1 = 1;
            }
            if (j >= 0)
            {
                f2 = num2[j--] - '0';
            }
            else
            {
                f2 = 1;
            }
            mul = f1 * f2 + addition;
            left = mul % 10;
            addition = mul / 10;
            s += left + '0';

        }
        reverse(s.begin(), s.end());
        return s;
    }
};
void test_string3()
{
    string s1("123");
    string s2("456");
    Solution s;
    s.multiply(s1, s2);
 
}
int main()
{
	test_string3();



	return 0;
}